Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(infiniteGrid): enhance performance about initialization #330

Merged
merged 1 commit into from
Aug 2, 2016

Conversation

sculove
Copy link
Contributor

@sculove sculove commented Aug 1, 2016

@sculove sculove added this to the 1.3.0 milestone Aug 1, 2016
@sculove sculove self-assigned this Aug 1, 2016
if (v.el) {
v.el.style.left = v.position.x + "px";
v.el.style.top = v.position.y + "px";
}
return v;
}, this);
});
},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think just one forEach is enough.

items.forEach(function(v) {
  v.position = this._getItemLayoutPosition(v);
  if (v.el) {
    v.el.style.left = v.position.x + "px";
    v.el.style.top = v.position.y + "px";  
  }
}, this);

Copy link
Contributor Author

@sculove sculove Aug 1, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kishu good.
but, in order to improve performance, we should separate appling dom actions.

@taihoon
Copy link

taihoon commented Aug 1, 2016

LGTM

@sculove sculove merged commit 3b097ce into master Aug 2, 2016
@sculove sculove deleted the improveImageLoad#325 branch August 2, 2016 01:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants